<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Welcome extends CI_Controller
{
	function __construct()
        {
		parent::__construct();
		$this->load->model('Administration');
		$this->load->model('mi_facebook_model');
	}
	
	public function index()
	{
		$this->load->view('layout/header');
		$data['fecha'] = $this->Administration->return_date_main();
		$data['activities'] = $this->Administration->return_activity();
		$data['positions'] = $this->Administration->return_positions();
		
		#-----------------
					
		$this->appId = '712944462084224';
		$this->secret = '58b2806877539684ebedfbe88cb9d226';
		$fb_config = array(
		    'appId' => $this->appId,
		    'secret' => $this->secret
		);
	 
		$this->load->library('facebook', $fb_config);
	 
		$user_id = $this->facebook->getUser();
		$token = $this->facebook->getAccessToken();
	 
		$data['login_url'] = $this->facebook->getLoginUrl(array(
			'scope' => 'email,user_birthday,publish_stream,offline_access', 'redirect_uri' => 'http://prode.indev.com.ar/login/byFacebook'));
		
		#-----------------
		
		$this->load->view('login',$data);
		$this->load->view('layout/footer');
	}
	
	public function load_rules()
        {
            $this->load->view('system/rules');
        }
}